package csu.web.jpetstore.domain;

import csu.web.jpetstore.persistence.impl.LoggerDAOImpl;
import javafx.beans.property.SimpleStringProperty;

import javax.swing.text.html.HTMLDocument;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Logger {
    private String username;
    private String action;
    private String starttime;
    private String lasttime;
    private Date currentDate;
    private boolean key;

    public void setCurrentDate(){
        this.currentDate=new Date();
    }
    public void setUsername(String username) {
        this.username = username;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public void setStarttime() {
        this.starttime = new Date().toString();
    }

    public void setStarttime(String starttime) {
        this.starttime = starttime;
    }

    public void setLasttime() {
        setCurrentDate();
        this.lasttime=currentDate.toString();
    }

    public void setLasttime(String time){
        this.lasttime=time;
    }
    public String getUsername() {
        return username;
    }

    public String getAction() {
        return action;
    }

    public String getStarttime() {
        return starttime;
    }

    public String getLasttime() {
        return lasttime;
    }

    public static void execute(Logger logger) throws SQLException {
        LoggerDAOImpl DAO=new LoggerDAOImpl();
        DAO.logger(logger);
    }
}
